﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TheClerk.Forms
{
    /// <summary>
    /// A detached signature over a Form
    /// </summary>
    /// <remarks>
    /// Used by the Clerk to prove that it did receive the Form-as-filed
    /// If appropriate, can be used for secure data access:
    /// Present the Receipt, and you can get the Form-as-filed.
    /// Present the derived Form instance from the Receipt, and you
    /// can get your data back.
    /// </remarks>
    public class Receipt : Form
    {
        /**
         * <summary>read-only serialization of a Form</summary>
         * <remarks>
         * This is the read-only serialization of a Form -- with our virtual
         * paper, the Form has enough space for the clerk to do anything
         * necessary, like a space for notarization is often left on things related
         * to ownership, and the date/time stamp that's used on court documents for
         * proof of date of filing, and certifications when they're needed.
         * </remarks>
         **/

        private byte[] fullreceipt;

        public override bool isComplete { get { return false; } }

        public Receipt()
        {
            fullreceipt = null;
        }

        // TODO Secure this -- it's just a bytecopy right now
        public Receipt(byte[] toSign)
        {
            fullreceipt = toSign;
        }

        /// <summary>
        /// Template
        /// </summary>
        public Form Template;

        public virtual bool isReceipt
        {
            get
            {
                return true;
            }
        }

    }
}
